<html data-ng-app>
<head>
<title>Eksempel</title>
<script src="/Scripts/angular.min.js"></script>
</head>
<body>
{{5+5}}
</body>
</html>
var myApp = angular.module('myApp',[]);
myApp.controller('controllerName', ['$scope', function($scope) {
}]);
var myApp = angular.module('myApp',[]);
myApp.controller('controllerName', ['$scope', function($scope) {
$scope.name = "Perry"
}]);
<html data-ng-app="myApp">
<head>
<title>Eksempel</title>
<script src="/Scripts/angular.min.js"></script>
</head>
<body data-ng-controller="controllerName">
{{name}}
</body>
</html>
Employee name
Employee experience
{{employee.name}}
{{employee.experience}}
myApp.config(['$routeProvider',
function($routeProvider, $route) {
$routeProvider.
when('/list', {
templateUrl: 'list.html',
controller: 'ListController'
}).
when('/edit/:id', {
templateUrl: 'edit.html',
controller: 'EditController'
}).
otherwise({
redirectTo: '/list'
});
}]);
Total row count: 2519
Watchers count: 15124
Scope count: 2521
Digest cycle: (High+Low)/2: 12.5 ms High: 18 Low: 7
Digest cycle: (High+Low)/2: 36.5 ms High: 44 Low: 29
<script src="angular-aria.js">
$http.get('/someUrl').
success(function(data) {
$scope.data = data;
}).
error(function(data) {
$log.error(data);
});
$scope.asyncGreet() {
return $q(function(resolve, reject) {
setTimeout(function() {
resolve('Hello, world!');
}, 1000);
});
}
var promise = $scope.asyncGreet();
promise.then(function(response) {
alert('Success: ' + response);
}, function(error) {
alert('Failed: ' + error);
});
i18n = internationalization
l10n = localization
<html ng-app>
<head>
<script src="i18n/angular-locale_de-de.js"></script>
<script src="i18n/angular-locale_no.js"></script>
</head>
</html>